using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.Serialization;
using System.Security.Permissions;

using CureConsulting;
using CureConsulting.Common;

namespace Blog.Net.Common.DataObjects
{
	[Serializable]
	public partial class BlogResponse : DataObjectBase
	{
		#region Constructors

		/// <summary>
		/// Create a BlogResponse object Empty Constructor
		/// </summary>
		public BlogResponse() { }

		/// <summary>
		/// Create a BlogResponse object Full Constructor
		/// </summary>
		/// <param name="Name"></param>
		/// <param name="Email"></param>
		/// <param name="Comment"></param>
		/// <param name="CreateDate"></param>
		/// <param name="BlogEntry"></param>
		public BlogResponse( string Name, string Email, string Comment, DateTime CreateDate, BlogEntry BlogEntry ) : this()
		{
			this.Name = Name;
			this.Email = Email;
			this.Comment = Comment;
			this.CreateDate = CreateDate;
			this.BlogEntry = BlogEntry;
		}
		/// <summary>
		/// Create a BlogResponse object from serialization
		/// </summary>
		protected BlogResponse(SerializationInfo info, StreamingContext context) : base(info, context)
      	{
			_name = (string)info.GetValue("_name", typeof(string));
			_email = (string)info.GetValue("_email", typeof(string));
			_comment = (string)info.GetValue("_comment", typeof(string));
			_createDate = (DateTime)info.GetValue("_createDate", typeof(DateTime));
			_blogEntry = (BlogEntry)info.GetValue("_blogEntry", typeof(BlogEntry));
      	}
		#endregion
		
		#region Member Variables
		
		protected string _name;
		protected string _email;
		protected string _comment;
		protected DateTime _createDate;
		protected BlogEntry _blogEntry;

		#endregion

		#region Public Properties
		
		/// <summary>
		/// BlogResponse Name
		/// </summary>
		public virtual string Name
		{
			get { return _name; }
			set
			{
				if (value != null && value.Length > 255)
					throw new ArgumentOutOfRangeException("Invalid value for Name", value, value.ToString());
				UpdateState(_name , value);
				_name = value;
			}
		}

		/// <summary>
		/// BlogResponse Email
		/// </summary>
		public virtual string Email
		{
			get { return _email; }
			set
			{
				if (value != null && value.Length > 255)
					throw new ArgumentOutOfRangeException("Invalid value for Email", value, value.ToString());
				UpdateState(_email , value);
				_email = value;
			}
		}

		/// <summary>
		/// BlogResponse Comment
		/// </summary>
		public virtual string Comment
		{
			get { return _comment; }
			set 
			{
				UpdateState(_comment , value);
				_comment = value;
			}
		}

		/// <summary>
		/// BlogResponse CreateDate
		/// </summary>
		public virtual DateTime CreateDate
		{
			get { return _createDate; }
			set 
			{
				UpdateState(_createDate , value);
				_createDate = value;
			}
		}

		/// <summary>
		/// BlogResponse BlogEntry
		/// </summary>
		public virtual BlogEntry BlogEntry
		{
			get { return _blogEntry; }
			set { _blogEntry = value; }
		}

		
		#endregion
		
		#region Methods
		/// <summary>
        /// Set object data for serialization
        /// </summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
      	[SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
		public override void GetObjectData(SerializationInfo info, StreamingContext context)
      	{
			info.AddValue("_name", _name);
			info.AddValue("_email", _email);
			info.AddValue("_comment", _comment);
			info.AddValue("_createDate", _createDate);
			info.AddValue("_blogEntry", _blogEntry);
         	base.GetObjectData(info, context);
      	}
		#endregion
	}
}